using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._LocationReferencingTools
{
    /// <summary>
    /// <para>Append Routes</para>
    /// <para>Appends routes from an input polyline into an LRS Network.</para>
    /// <para>将路由从输入折线追加到 LRS 网络中。</para>
    /// </summary>    
    [DisplayName("Append Routes")]
    public class AppendRoutes : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public AppendRoutes()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_source_routes">
        /// <para>Source Routes</para>
        /// <para>The input from which the routes will be derived. The input can be a polyline feature class, shapefile, feature service, or LRS Network feature class.</para>
        /// <para>从中派生路由的输入。输入可以是折线要素类、shapefile、要素服务或 LRS 网络要素类。</para>
        /// </param>
        /// <param name="_in_lrs_network">
        /// <para>LRS Network</para>
        /// <para>The target LRS Network into which the routes will be loaded.</para>
        /// <para>将路由加载到的目标 LRS 网络。</para>
        /// </param>
        /// <param name="_route_id_field">
        /// <para>Route ID Field</para>
        /// <para>The field in the input polyline feature class that will be mapped to the LRS Network route ID. The field type must match the RouteID field type of the target LRS Network and must be either a string or GUID field type. If it is a text field, the field length must be shorter than or equal to the length of the target RouteID field.</para>
        /// <para>输入折线要素类中将映射到 LRS 网络路径 ID 的字段。字段类型必须与目标 LRS 网络的 RouteID 字段类型匹配，并且必须是字符串或 GUID 字段类型。如果是文本字段，则字段长度必须短于或等于目标 RouteID 字段的长度。</para>
        /// </param>
        public AppendRoutes(object _source_routes, object _in_lrs_network, object _route_id_field)
        {
            this._source_routes = _source_routes;
            this._in_lrs_network = _in_lrs_network;
            this._route_id_field = _route_id_field;
        }
        public override string ToolboxName => "Location Referencing Tools";

        public override string ToolName => "Append Routes";

        public override string CallName => "locref.AppendRoutes";

        public override List<string> AcceptEnvironments => ["workspace"];

        public override object[] ParameterInfo => [_source_routes, _in_lrs_network, _route_id_field, _route_name_field, _from_date_field, _to_date_field, _line_id_field, _line_name_field, _line_order_field, _field_map, _load_type.GetGPValue(), _out_lrs_network, _out_details_file];

        /// <summary>
        /// <para>Source Routes</para>
        /// <para>The input from which the routes will be derived. The input can be a polyline feature class, shapefile, feature service, or LRS Network feature class.</para>
        /// <para>从中派生路由的输入。输入可以是折线要素类、shapefile、要素服务或 LRS 网络要素类。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Source Routes")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _source_routes { get; set; }


        /// <summary>
        /// <para>LRS Network</para>
        /// <para>The target LRS Network into which the routes will be loaded.</para>
        /// <para>将路由加载到的目标 LRS 网络。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("LRS Network")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_lrs_network { get; set; }


        /// <summary>
        /// <para>Route ID Field</para>
        /// <para>The field in the input polyline feature class that will be mapped to the LRS Network route ID. The field type must match the RouteID field type of the target LRS Network and must be either a string or GUID field type. If it is a text field, the field length must be shorter than or equal to the length of the target RouteID field.</para>
        /// <para>输入折线要素类中将映射到 LRS 网络路径 ID 的字段。字段类型必须与目标 LRS 网络的 RouteID 字段类型匹配，并且必须是字符串或 GUID 字段类型。如果是文本字段，则字段长度必须短于或等于目标 RouteID 字段的长度。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Route ID Field")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _route_id_field { get; set; }


        /// <summary>
        /// <para>Route Name Field</para>
        /// <para>The field in the input polyline feature class that will be mapped as the LRS Network route name. The field must be a string field, and the field length must be shorter than or equal to the length of the target route name field.</para>
        /// <para>输入折线要素类中将映射为 LRS 网络路径名称的字段。该字段必须是字符串字段，并且字段长度必须短于或等于目标路由名称字段的长度。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Route Name Field")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _route_name_field { get; set; } = null;


        /// <summary>
        /// <para>From Date Field</para>
        /// <para>A date field in the input polyline feature class that will be mapped as the From Date Field in the LRS Network . If the field is not mapped, a null value representing the beginning of time will be provided for all appended routes.</para>
        /// <para>输入折线要素类中的日期字段，该字段将映射为 LRS 网络中的起始日期字段。如果未映射该字段，则将为所有附加的路径提供表示时间开始的 null 值。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("From Date Field")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _from_date_field { get; set; } = null;


        /// <summary>
        /// <para>To Date Field</para>
        /// <para>A date field in the input polyline feature class that will be mapped as the To date in the LRS Network. If a To date field is not mapped, a null value representing the end of time will be provided for all appended routes.</para>
        /// <para>输入折线要素类中的日期字段，将在 LRS 网络中映射为截至日期。如果未映射“截至日期”字段，则将为所有追加的路径提供表示时间结束的 null 值。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("To Date Field")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _to_date_field { get; set; } = null;


        /// <summary>
        /// <para>Line ID Field</para>
        /// <para>The field in the input polyline feature class that will be mapped as the LRS Network line ID. This parameter is only used if the target is an LRS line network. The field type must match the RouteID field type of the centerline sequence table and must be either a string of exactly 38 characters or a GUID field type.</para>
        /// <para>输入折线要素类中将映射为 LRS 网络线 ID 的字段。仅当目标是 LRS 线路网络时，才使用此参数。字段类型必须与中心线序列表的 RouteID 字段类型匹配，并且必须是正好包含 38 个字符的字符串或 GUID 字段类型。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Line ID Field")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _line_id_field { get; set; } = null;


        /// <summary>
        /// <para>Line Name Field</para>
        /// <para>The string field in the input polyline feature class that will be mapped as the LRS Network line name. This parameter is only used if the target is an LRS line network.</para>
        /// <para>输入折线要素类中将映射为 LRS 网络线名称的字符串字段。仅当目标是 LRS 线路网络时，才使用此参数。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Line Name Field")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _line_name_field { get; set; } = null;


        /// <summary>
        /// <para>Line Order Field</para>
        /// <para><xdoc>
        ///   <para>The long integer field in the input polyline feature class that will be mapped as the LRS Network line order. This parameter is only used if the target is an LRS line network.</para>
        ///   <para>Learn more about line networks and line order in Pipeline Referencing or line networks and line order in Roads and Highways.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>输入折线要素类中的长整型字段，该字段将映射为 LRS 网络线顺序。仅当目标是 LRS 线路网络时，才使用此参数。</para>
        ///   <para>了解有关管线参照中的管线网络和线顺序或道路和高速公路中的管线网络和线顺序的详细信息。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Line Order Field")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _line_order_field { get; set; } = null;


        /// <summary>
        /// <para>Field Map</para>
        /// <para>Controls how attribute information in the source route fields is transferred to the input LRS Network. Fields cannot be added to or removed from the target LRS Network because the data of the source routes is appended to an existing LRS Network that has a predefined schema. While you can set merge rules for each output field, the tool will ignore those rules.</para>
        /// <para>控制如何将源路径字段中的属性信息传输到输入 LRS 网络。无法向目标 LRS 网络添加或移除字段，因为源路径的数据将追加到具有预定义方案的现有 LRS 网络。虽然您可以为每个输出字段设置合并规则，但该工具将忽略这些规则。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Field Map")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _field_map { get; set; } = null;


        /// <summary>
        /// <para>Load Type</para>
        /// <para><xdoc>
        ///   <para>Specifies how appended routes with measure or temporality overlaps with identical route IDs as Target Network records are loaded into the network feature class.</para>
        ///   <bulletList>
        ///     <bullet_item>Add—The appended routes are loaded into the target LRS Network. If any route ID in the source routes already exists in the target LRS Network with the same temporality, it will be written to the output log as a duplicate route and must be corrected or filtered out before completing the loading process. This is the default.</bullet_item><para/>
        ///     <bullet_item>Retire by route ID—The appended routes are loaded into the target LRS Network and any routes in the target LRS Network that have the same route ID and temporality overlap as the appended routes are retired. If the appended route eclipses a target route with the same route ID, the target route is deleted.</bullet_item><para/>
        ///     <bullet_item>Replace by route ID—The appended routes are loaded into the target LRS Network and any routes in the target LRS Network with the same route ID as the appended routes are deleted.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定在将目标网络记录加载到网络要素类时，附加的具有度量或时态的路径如何与相同的路径 ID 重叠。</para>
        ///   <bulletList>
        ///     <bullet_item>添加 - 追加的路径将加载到目标 LRS 网络中。如果源路由中的任何路由 ID 已存在于目标 LRS 网络中，则该路由将作为重复路由写入输出日志，并且必须在完成加载过程之前进行更正或过滤掉。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>按路由 ID 停用 - 附加的路由将加载到目标 LRS 网络中，并且目标 LRS 网络中与附加路由具有相同路由 ID 和时态重叠的任何路由都将被停用。如果附加的路由使具有相同路由 ID 的目标路由黯然失色，则将删除该目标路由。</bullet_item><para/>
        ///     <bullet_item>替换为路径 ID - 附加的路径将加载到目标 LRS 网络中，并且目标 LRS 网络中与附加路径 ID 相同的路径都将被删除。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Load Type")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _load_type_value _load_type { get; set; } = _load_type_value._ADD;

        public enum _load_type_value
        {
            /// <summary>
            /// <para>Add</para>
            /// <para>Add—The appended routes are loaded into the target LRS Network. If any route ID in the source routes already exists in the target LRS Network with the same temporality, it will be written to the output log as a duplicate route and must be corrected or filtered out before completing the loading process. This is the default.</para>
            /// <para>添加 - 追加的路径将加载到目标 LRS 网络中。如果源路由中的任何路由 ID 已存在于目标 LRS 网络中，则该路由将作为重复路由写入输出日志，并且必须在完成加载过程之前进行更正或过滤掉。这是默认设置。</para>
            /// </summary>
            [Description("Add")]
            [GPEnumValue("ADD")]
            _ADD,

            /// <summary>
            /// <para>Retire by route ID</para>
            /// <para>Retire by route ID—The appended routes are loaded into the target LRS Network and any routes in the target LRS Network that have the same route ID and temporality overlap as the appended routes are retired. If the appended route eclipses a target route with the same route ID, the target route is deleted.</para>
            /// <para>按路由 ID 停用 - 附加的路由将加载到目标 LRS 网络中，并且目标 LRS 网络中与附加路由具有相同路由 ID 和时态重叠的任何路由都将被停用。如果附加的路由使具有相同路由 ID 的目标路由黯然失色，则将删除该目标路由。</para>
            /// </summary>
            [Description("Retire by route ID")]
            [GPEnumValue("RETIRE_BY_ROUTE_ID")]
            _RETIRE_BY_ROUTE_ID,

            /// <summary>
            /// <para>Replace by route ID</para>
            /// <para>Replace by route ID—The appended routes are loaded into the target LRS Network and any routes in the target LRS Network with the same route ID as the appended routes are deleted.</para>
            /// <para>替换为路径 ID - 附加的路径将加载到目标 LRS 网络中，并且目标 LRS 网络中与附加路径 ID 相同的路径都将被删除。</para>
            /// </summary>
            [Description("Replace by route ID")]
            [GPEnumValue("REPLACE_BY_ROUTE_ID")]
            _REPLACE_BY_ROUTE_ID,

        }

        /// <summary>
        /// <para>LRS Network</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("LRS Network")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _out_lrs_network { get; set; }


        /// <summary>
        /// <para>Output Results File</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Results File")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _out_details_file { get; set; }


        public AppendRoutes SetEnv(object workspace = null)
        {
            base.SetEnv(workspace: workspace);
            return this;
        }

    }

}